package a.f;

public class ad
{
  public static final int a = 1;
  public static final int b = 4;
  public static final int c = 8;
  public static final int d = 2;
  public static final int e = 16;
  public static final int f = 32;
  public static final int g = 64;
  public static final int h = 128;
  public static final int i = 255;
  private static final ad[] j = new ad[256];
  private static final ad[] k = new ad[256];
  private double l;
  private double m;
  private boolean n;
  private int o;
  private double p;
  public static final Object q = "y.layout.PortCandidate.SOURCE_PCLIST_DPKEY";
  public static final Object r = "y.layout.PortCandidate.TARGET_PCLIST_DPKEY";
  private static final byte[] s = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15 };
  private static final byte[] t = { 0, 4, 8, 12, 2, 6, 10, 14, 1, 5, 9, 13, 3, 7, 11, 15 };
  private static final byte[] u = { 0, 8, 4, 12, 1, 9, 5, 13, 2, 10, 6, 14, 3, 11, 7, 15 };
  public static boolean v;
  
  protected ad(double paramDouble1, double paramDouble2, boolean paramBoolean, int paramInt, double paramDouble3)
  {
    this.l = paramDouble1;
    this.m = paramDouble2;
    this.n = paramBoolean;
    this.o = (paramInt & 0xFF);
    this.p = paramDouble3;
  }
  
  protected ad(double paramDouble1, double paramDouble2, int paramInt)
  {
    this(paramDouble1, paramDouble2, true, paramInt, 0.0D);
  }
  
  protected ad(int paramInt)
  {
    this(0.0D, 0.0D, false, paramInt, 0.0D);
  }
  
  protected ad(int paramInt, double paramDouble)
  {
    this(0.0D, 0.0D, false, paramInt, paramDouble);
  }
  
  public boolean a(int paramInt)
  {
    if (!o.eg) {}
    return (this.o & paramInt) != 0;
  }
  
  public int a()
  {
    return this.o;
  }
  
  public boolean b()
  {
    return this.n;
  }
  
  public double c()
  {
    return this.l;
  }
  
  public double d()
  {
    return this.m;
  }
  
  public static ad b(int paramInt)
  {
    return a(paramInt, 0.0D);
  }
  
  public static ad a(int paramInt, double paramDouble)
  {
    boolean bool = o.eg;
    int i1 = paramInt & 0xFF;
    ad localad;
    if (!bool) {
      if (paramDouble == 0.0D)
      {
        localad = j[i1];
        if (!bool) {
          if (localad == null)
          {
            localad = new ad(paramInt);
            j[i1] = localad;
          }
        }
        return localad;
      }
    }
    if (paramDouble == 1.0D)
    {
      localad = k[i1];
      if (!bool) {
        if (localad == null)
        {
          localad = new ad(paramInt);
          localad.p = 1.0D;
          k[i1] = localad;
        }
      }
      return localad;
    }
    return new ad(paramInt, paramDouble);
  }
  
  public static ad a(double paramDouble1, double paramDouble2, int paramInt)
  {
    return a(paramDouble1, paramDouble2, paramInt, 0.0D);
  }
  
  public static ad a(double paramDouble1, double paramDouble2, int paramInt, double paramDouble3)
  {
    return new ad(paramDouble1, paramDouble2, true, paramInt, paramDouble3);
  }
  
  public static ad a(cd paramcd)
  {
    if (!o.eg) {
      if (paramcd.g()) {
        return b(15);
      }
    }
    return b(paramcd.b());
  }
  
  public int hashCode()
  {
    if (!o.eg) {}
    return (this.n ? 4096 : 0) + this.o + (int)(Double.doubleToLongBits(this.p) + Double.doubleToLongBits(this.l) + Double.doubleToLongBits(this.m));
  }
  
  public cd e()
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    byte b1;
    if (!bool) {
      switch (this.o)
      {
      case 1: 
      case 2: 
      case 4: 
      case 8: 
        b1 = (byte)this.o;
        if (bool) {
          break label150;
        }
        if (i1 == 0) {
          break;
        }
      case 16: 
        b1 = 2;
        if (bool) {
          break label150;
        }
        if (i1 == 0) {
          break;
        }
      case 32: 
        b1 = 1;
        if (bool) {
          break label150;
        }
        if (i1 == 0) {
          break;
        }
      case 64: 
        b1 = 4;
        if (bool) {
          break label150;
        }
        if (i1 == 0) {
          break;
        }
      case 128: 
        b1 = 8;
        if (bool) {
          break label150;
        }
        if (i1 == 0) {
          break;
        }
      }
    } else {
      b1 = 0;
    }
    label150:
    return cd.a(b1, b());
  }
  
  public cd a(byte paramByte)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    byte b1;
    if (!bool) {
      switch (b(paramByte))
      {
      case 1: 
      case 2: 
      case 4: 
      case 8: 
        b1 = (byte)this.o;
        if (bool) {
          break label155;
        }
        if (i1 == 0) {
          break;
        }
      case 16: 
        b1 = 2;
        if (bool) {
          break label155;
        }
        if (i1 == 0) {
          break;
        }
      case 32: 
        b1 = 1;
        if (bool) {
          break label155;
        }
        if (i1 == 0) {
          break;
        }
      case 64: 
        b1 = 4;
        if (bool) {
          break label155;
        }
        if (i1 == 0) {
          break;
        }
      case 128: 
        b1 = 8;
        if (bool) {
          break label155;
        }
        if (i1 == 0) {
          break;
        }
      }
    } else {
      b1 = 0;
    }
    label155:
    return cd.a(b1, b());
  }
  
  public boolean equals(Object paramObject)
  {
    boolean bool = o.eg;
    if (!bool) {
      if (this == paramObject) {
        return true;
      }
    }
    if (!bool) {
      if (!(paramObject instanceof ad)) {
        return false;
      }
    }
    if (!bool) {
      if (paramObject.getClass() != getClass()) {
        return false;
      }
    }
    ad localad = (ad)paramObject;
    if (((bool) || (localad.n == this.n)) && ((bool) || (localad.l == this.l)) && ((bool) || (localad.p == this.p)) && ((bool) || (localad.m == this.m))) {
      if (bool) {}
    }
    return localad.o == this.o;
  }
  
  public double f()
  {
    return this.p;
  }
  
  public int b(byte paramByte)
  {
    boolean bool = o.eg;
    int i3 = o.dg;
    if (!bool) {}
    byte[] arrayOfByte;
    switch (paramByte)
    {
    case 0: 
    default: 
      return a();
    case 2: 
      arrayOfByte = s;
      if (!bool) {
        if (i3 == 0) {
          break;
        }
      }
      break;
    case 1: 
      arrayOfByte = t;
      if (!bool) {
        if (i3 == 0) {
          break;
        }
      }
      break;
    case 3: 
      arrayOfByte = u;
    }
    int i1 = a();
    int i2 = i1 & 0xF;
    i1 &= 0xFFFFFFF0;
    return i1 | arrayOfByte[i2];
  }
  
  public double a(byte paramByte, int paramInt)
  {
    if (!o.eg) {
      switch (paramByte)
      {
      case 0: 
      default: 
        if ((paramInt & 0x1) != 0) {
          return -c();
        }
        return c();
      case 2: 
        if ((paramInt & 0x4) != 0) {
          return c();
        }
        return -c();
      case 1: 
        if ((paramInt & 0x8) != 0) {
          return d();
        }
        return -d();
      }
    }
    if ((paramInt & 0x2) != 0) {
      return -d();
    }
    return d();
  }
  
  public double b(byte paramByte, int paramInt)
  {
    switch (paramByte)
    {
    case 0: 
    default: 
      return d();
    case 2: 
      return -d();
    case 1: 
      return c();
    }
    return -c();
  }
  
  public double c(byte paramByte)
  {
    switch (paramByte)
    {
    case 0: 
    default: 
      return c();
    case 2: 
      return c();
    case 1: 
      return -d();
    }
    return d();
  }
  
  public double d(byte paramByte)
  {
    switch (paramByte)
    {
    case 0: 
    default: 
      return d();
    case 2: 
      return -d();
    case 1: 
      return c();
    }
    return -c();
  }
  
  public String toString()
  {
    boolean bool = o.eg;
    StringBuffer localStringBuffer = new StringBuffer(50);
    localStringBuffer.append("PortCandidate(");
    if (!bool)
    {
      localStringBuffer.append('(').append(this.l).append(':').append(this.m).append(')');
      if (this.n)
      {
        localStringBuffer.append("[fixed]");
        if (bool) {
          break label92;
        }
        if (o.dg == 0) {
          break label87;
        }
      }
    }
    localStringBuffer.append("[free]");
    label87:
    label92:
    if (!bool) {
      if (a(1)) {
        localStringBuffer.append(" NORTH");
      }
    }
    if (!bool) {
      if (a(4)) {
        localStringBuffer.append(" EAST");
      }
    }
    if (!bool) {
      if (a(2)) {
        localStringBuffer.append(" SOUTH");
      }
    }
    if (!bool) {
      if (a(8)) {
        localStringBuffer.append(" WEST");
      }
    }
    if (!bool) {
      if (a(32)) {
        localStringBuffer.append(" AGAINST_THE_FLOW");
      }
    }
    if (!bool) {
      if (a(16)) {
        localStringBuffer.append(" WITH_THE_FLOW");
      }
    }
    if (!bool) {
      if (a(64)) {
        localStringBuffer.append(" LEFT_IN_FLOW");
      }
    }
    if (a(128)) {
      localStringBuffer.append(" RIGHT_IN_FLOW");
    }
    localStringBuffer.append(", cost=");
    localStringBuffer.append(this.p);
    localStringBuffer.append(')');
    return localStringBuffer.toString();
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.ad
 * JD-Core Version:    0.7.0.1
 */